type Filter<T extends any[], N, F extends any[] = []> = T extends [
  infer L,
  ...infer R
]
  ? [L] extends [N] //防止分发，不分发数据中有any就会有问题
    ? Filter<R, N, F>
    : Filter<R, N, [...F, L]>
  : F;

type Filter2<T extends any[], N, F extends any[] = []> = T extends [
  infer L,
  ...infer R
]
  ? Filter2<R, N, [L] extends [N] ? F : [...F, L]>
  : F;
type a1 = Filter<[2, "r", "5", 3], number>; //["r", "5"]
type a11 = Filter<[2, "r", "5", 3], string>; //["r", "5"]
type a12 = Filter<[2, "r", "5", any,3], string>; //["r", "5"]
type a2 = Filter2<[2, "r", "5", 3], number>; //["r", "5"]
export {};
